//获取时间函数
//debugger打断点
function getTime(){
    var date = new Date();
    var year = date.getFullYear();
    var month = date.getMonth()+1;      //会比正常少1
    var day = date.getDay();  //星期几
    var date2 = date.getDate();
    var hour = date.getHours();//时
    debugger;
    var minutes = date.getMinutes();//分
    var second = date.getSeconds();//秒
    if(hour==8&&minutes==45){
        document.getElementById("clock").innerHTML = "下课了！";
    }else{
        document.getElementById("clock").innerHTML = year+"年"+month+"月"+date2+"日"+"星期"+day+"  "+hour+"时："+minutes+"分："+second+"秒";
    }
}
// setTimeout("getTime()",2000);//定时后执行,单位毫秒,只会执行一次
setInterval("getTime()",1000);//周期执行